package com.hoshiibuy.customerOperation.entity.param;

import java.io.Serializable;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hoshiibuy.common.query.CommonParam;
import com.hoshiibuy.customerOperation.entity.Cart;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 查询购物车购物信息记录表参数
 * </p>
 * 
 * @author Mr.Wu
 * @since 2019-04-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "查询购物车购物信息记录表", description = "查询购物车购物信息记录表")
public class CartQueryParam extends CommonParam implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	@ApiModelProperty(value = "主键ID", required = true)
	private Long recId;

	@ApiModelProperty(value = "用户id，取自session，")
	private Long userId;

	@ApiModelProperty(value = "商品id")
	private Long goodsId;

	@ApiModelProperty(value = "状态   0-失效 1-有效")
	private Integer status;

	public QueryWrapper<Cart> getQueryWrapper() {
		QueryWrapper<Cart> queryWrapper = new QueryWrapper<Cart>();
		queryWrapper.eq(this.recId != null, "rec_id", this.recId);
		queryWrapper.eq(this.userId != null, "user_id", this.userId);
		queryWrapper.eq(this.goodsId != null, "goods_id", this.goodsId);
		queryWrapper.eq(this.status != null, "status", this.status);
		return queryWrapper;
	}
}
